home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / dev / c / AsyncIOPPCdev.lha / AsyncIOPPCdev / Include / libraries / asyncio.h
Encoding:
C/C++ Source or Header  |  2000-07-22  |  1.9 KB  |  89 lines

  1. #ifndef LIBRARIES_ASYNCIO_H
  2. #define LIBRARIES_ASYNCIO_H
  3.  
  4.  
  5. /*****************************************************************************/
  6.  
  7.  
  8. #ifndef EXEC_TYPES_H
  9. #include <exec/types.h>
  10. #endif
  11.  
  12. #ifndef EXEC_PORTS_H
  13. #include <exec/ports.h>
  14. #endif
  15.  
  16. #ifndef DOS_DOS_H
  17. #include <dos/dos.h>
  18. #endif
  19.  
  20. #ifndef DOS_DOSEXTENS_H
  21. #include <dos/dosextens.h>
  22. #endif
  23.  
  24.  
  25. /*****************************************************************************/
  26.  
  27.  
  28. /* This structure is public only by necessity, don't muck with it yourself, or
  29.  * you're looking for trouble
  30.  */
  31.  
  32. typedef struct AsyncFile
  33. #ifdef __GNUC__
  34. __attribute__((aligned(2),packed))
  35. #endif
  36. {
  37.     BPTR            af_File;
  38.     ULONG            af_BlockSize;
  39.     struct MsgPort        *af_Handler;
  40.     UBYTE            *af_Offset;
  41.     LONG            af_BytesLeft;
  42.     ULONG            af_BufferSize;
  43.     UBYTE            *af_Buffers[2];
  44.     struct StandardPacket    af_Packet;
  45.     struct MsgPort        af_PacketPort;
  46.     ULONG            af_CurrentBuf;
  47.     ULONG            af_SeekOffset;
  48. #ifdef ASIO_NOEXTERNALS
  49.     struct ExecBase        *af_SysBase;
  50.     struct DosLibrary    *af_DOSBase;
  51. #endif
  52.     UBYTE            af_PacketPending;
  53.     UBYTE            af_ReadMode;
  54.     UBYTE            af_CloseFH;
  55.     UBYTE            af_SeekPastEOF;
  56.     ULONG            af_LastRes1;
  57.     ULONG            af_LastBytesLeft;
  58. } AsyncFile;
  59.  
  60.  
  61. /*****************************************************************************/
  62.  
  63.  
  64. typedef enum OpenModes
  65. {
  66.     MODE_READ,    /* read an existing file                             */
  67.     MODE_WRITE,    /* create a new file, delete existing file if needed */
  68.     MODE_APPEND    /* append to end of existing file, or create new     */
  69. } OpenModes;
  70.  
  71.  
  72. typedef enum SeekModes
  73. {
  74.     MODE_START = -1,    /* relative to start of file         */
  75.     MODE_CURRENT,        /* relative to current file position */
  76.     MODE_END        /* relative to end of file           */
  77. } SeekModes;
  78.  
  79.  
  80. /*****************************************************************************/
  81.  
  82.  
  83. #if defined(__SASC) && defined(ASIO_SHARED_LIB)
  84. extern long __asiolibversion;  /* Minimum version of asyncio.library */
  85. #endif
  86.  
  87.  
  88. #endif /* ASYNCIO_H */
  89.